function getDomainName()
{

    if(location.host.indexOf("dev.com")>=0)
    {
        return   ".dev.com";
    }else if(location.host.indexOf("masamaso.com")>=0)
    {
        return ".masamaso.com";
    }
    return location.host;
}

// JavaScript Document
function getCookie(name)
{
    var cookieValue = "";
    var search = name + "=";
    if(document.cookie.length > 0)
    {
        offset = document.cookie.indexOf(search);
        if (offset != -1)
        {
            offset += search.length;
            end = document.cookie.indexOf(";", offset);
            if (end == -1) end = document.cookie.length;
            cookieValue = unescape(document.cookie.substring(offset, end))
        }
    }
    return cookieValue;
}

function setCookie(cookieName,cookieValue,DayValue)
{
    var expire = "";
    var day_value=1;
    if(DayValue!=null)
    {
        day_value=DayValue;
    }
    expire = new Date((new Date()).getTime() + day_value * 86400000);
    expire = "; expires=" + expire.toGMTString();
    document.cookie = cookieName + "=" + escape(cookieValue) +";path=/"+ expire+";domain="+getDomainName();
}

function delCookie(cookieName)
{
    var expire = "";
    expire = new Date((new Date()).getTime() - 1 );
    expire = "; expires=" + expire.toGMTString();
    document.cookie = cookieName + "=" + escape("") +";path=/"+ expire+";domain="+getDomainName();
//path=/
}